import request from '/@/utils/request';

export function fetchList(query?: Object) {
  return request({
    url: '/zhaikucloud/mallPanel/page',
    method: 'get',
    params: query
  })
}

export function fetchListAll(query?: Object) {
  return request({
    url: '/zhaikucloud/mallPanel/all',
    method: 'get',
    params: query
  })
}

export function addObj(obj?: Object) {
  return request({
    url: '/zhaikucloud/mallPanel',
    method: 'post',
    data: obj
  })
}

export function getObj(id?: string) {
  return request({
    url: '/zhaikucloud/mallPanel/' + id,
    method: 'get'
  })
}

export function delObj(ids?: Object) {
  return request({
    url: '/zhaikucloud/mallPanel/',
    method: 'delete',
    data: ids
  })
}

export function putObj(obj?: Object) {
  return request({
    url: '/zhaikucloud/mallPanel',
    method: 'put',
    data: obj
  })
}

export function fetchPanelTree(lazy?: Object, parentId?: Object) {
  return request({
    url: '/zhaikucloud/mallPanel/tree',
    method: 'get',
    params: {lazy: lazy, parentId: parentId}
  })
}
